/*
Created		26/08/2009
Modified		17/08/2010
Project		CIMa Planning
Model			Main
Company		CPIngredientes
Author		RGM
Version		0.1
Database		MS SQL 2000 
*/


Create table [bushels]
(
	[bushel_id] Integer Identity NOT NULL,
	[month_period_id] Integer NOT NULL,
	[date] Datetime NOT NULL,
	[amount] Decimal(18,4) NOT NULL,
Primary Key ([bushel_id])
) 
go


Alter table [bushels] add  foreign key([month_period_id]) references [months_periods] ([month_period_id])  on update no action on delete cascade 
go


Create table [corns_origins]
(
	[corn_origin] Char(1) NOT NULL,
	[description] Varchar(255) NOT NULL,
Primary Key ([corn_origin])
) 
go

INSERT INTO corns_origins VALUES ('I', 'Importado')
GO
INSERT INTO corns_origins VALUES ('N', 'Nacional')
GO


Alter table [corn_futures] add  foreign key([corn_origin]) references [corns_origins] ([corn_origin])  on update no action on delete no action 
go
Alter table [corn_futures_versions] add  foreign key([corn_origin]) references [corns_origins] ([corn_origin])  on update no action on delete no action 
go
Alter table [corns_types] add  foreign key([corn_origin]) references [corns_origins] ([corn_origin])  on update no action on delete no action 
go


Set quoted_identifier on
go



Set quoted_identifier off
go


